package com.efast.cafe.util;

import java.lang.reflect.Constructor;

public class ProxyDelegate {
	public static Object invoke(String className,String methodName,Object[] params) throws Exception{
		Object result=null;
		Class<?> clazz;
			clazz = Class.forName(className);
			Constructor<?> constructor=clazz.getConstructor();
			Object object=constructor.newInstance();
			ReflactObject delegate=new ReflactObject();
			delegate.setTarget(object);
			delegate.setMethodName(methodName);
			delegate.setParams(params);
			result = delegate.doMethod();
			return result;
	}
}
